package com.zlkj.pro.modular.business.model.dto;


import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import com.zlkj.pro.core.util.StrUtils;
import lombok.Data;

/**
 * @author liyang
 * @date 2024/4/6
 * @time 14:34
 */
@Data
public class MyBaseRequest extends BaseRequest implements java.io.Serializable {

    private java.lang.String order;
    private java.lang.String sort;
    private java.lang.Integer offset;

    public Integer getOffset() {
        if (this.getPageNo() != null && this.getPageSize() != null) {
            return (this.getPageNo() - 1) * this.getPageSize();
        } else {
            return null;
        }
    }

    public String getSort() {
        if (this.sort != null) {
            return StrUtils.camelToUnderscore(this.sort);
        } else {
            return null;
        }
    }

}